package main;

import java.io.BufferedReader;
import java.io.Console;
import java.io.InputStreamReader;
import server.data.DataManager;
import server.net.ServerCore;
import util.Algo;

/**
 *
 * @author Danon
 */
public class Main {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        DataManager.getInstance().init();
        ServerCore.getInstance().start();
        Console c = System.console();
        String s1, s2;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        do{
            
            try {
                System.out.print("File 1: ");
                s1 = br.readLine();
                System.out.print("File 2: ");
                s2 = br.readLine();
                System.out.println("The minimal distance is: " + 
                                                Algo.Dijkstra(DataManager.getInstance().getGraph(), s1, s2));
            } catch (Exception ex) { 
                break; 
            }
//            if(s1.equalsIgnoreCase("exit")) break;
//            s = null;
        } while(true);
        ServerCore.getInstance().stop();
    }
}
